fix: close claude query in probe finalizer#1757
fix: close claude query in probe finalizer#1757StayBlue wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Simple bug fix that improves resource cleanup by using the query's built-in close() method instead of an external AbortController. The change is small, self-contained, and only affects cleanup logic in a single function. You can customize Macroscope's approvability policy. Learn more. |
What Changed
ClaudeProvider.tsusesq.close()for cleanup instead ofabort.abort().Why
abort.abort()could throwAbortErrorduring shutdown and crash startup.q.close()uses the SDK's own disposal path, so the probe still getsinitializationResult()and no longer crashes on cleanup.Checklist
Note
Low Risk
Low risk: small, localized cleanup change in the Claude capabilities probe that should only affect process disposal behavior and reduce abort-related errors.
Overview
Updates the Claude SDK capability probe in
ClaudeProvider.tsto clean up by callingq.close()in theEffect.ensuringfinalizer instead of aborting via anAbortController.This prevents
AbortError-style failures during probe teardown while still allowinginitializationResult()to be read for subscription detection.Reviewed by Cursor Bugbot for commit f964cf2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
claudeQuerycleanup inprobeClaudeCapabilitiesfinalizerReplaces
AbortController-based cleanup with an explicitq.close()call in the finalizer block ofprobeClaudeCapabilitiesin ClaudeProvider.ts. TheclaudeQueryinstance is now stored in an outer-scoped variableqand closed during the ensuring phase, removing theabortControlleroption from the query constructor.Macroscope summarized f964cf2.